package com.example.authority.service;

import com.example.authority.domain.Menu;
import com.example.authority.domain.Role;
import com.example.authority.domain.User;
import org.springframework.security.core.GrantedAuthority;

import java.util.List;
import java.util.Set;

/**
* @author Limhuang
* @description 针对表【sys_user】的数据库操作Service
* @createDate 2024-06-23 22:12:37
*/
public interface UserService  {
    User getUserByUserName(String username);

    User register(User user);


    User registerByPhone(User user,String code);

    Set<GrantedAuthority> getAuthorities(Long userId);

    Set<Role> getRoles(String username);

    List<Menu> getMenus(String username);

    User addRole(Long userId, Long roleId);

    User addRoles(Long userId, List<Long> roleIds);

    User removeRole(Long userId, Long roleId);

    User removeRoles(Long userId, List<Long> roleIds);

    User updateRoles(Long userId, List<Long> roleIds);
}
